var app=getApp(),api=require('../../../../api.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    sexArr: [
      {
        type:0,
        value: '女'
      },
      {
        type: 1,
        value: '男'
      }
    ],
  
    userSex: '',
  },
  userChangeSex: function(e){
    var index = e.detail.value;
    var that = this;

    // TODO 执行远程提交

    that.setData({
      userSex: that.data.sexArr[index]
    });
  }
  ,
  onShow:function(){
    var that=this;
    app.request({
      url:api.default.userinfos,
      data:{
        uid:wx.getStorageSync('uid')
      },
      success:function(e){
        if(e.code==1){
        that.setData({
          info:e.data
        })
        }else{
          wx.showModal({
            title: '提示',
            content: '获取用户信息失败',
          })
        }
      }
    })
  }
})